Skip to content

rustc_metadata: track the simplified Self type for every trait impl.#75008

Merged
bors merged 1 commit intorust-lang:masterfrom
eddyb:rmeta-indexed-trait-impls
Aug 6, 2020
Merged

rustc_metadata: track the simplified Self type for every trait impl.#75008
bors merged 1 commit intorust-lang:masterfrom
eddyb:rmeta-indexed-trait-impls

Conversation

@eddyb
Copy link
Copy Markdown
Member

@eddyb eddyb commented Aug 1, 2020

For the traits_impls_of query, we index the impls by fast_reject::SimplifiedType (a "shallow type"), which allows some simple cases like impl Trait<..> for Foo<..> to be efficiently iterated over, by e.g. for_each_relevant_impl.

This PR encodes the fast_reject::SimplifiedType cross-crate to avoid needing to deserialize the Self type of every impl in order to simplify it - the simplification itself should be cheap, but the deserialization is less so.

We could go further from here and make loading the list of impls lazy, for a given simplified Self type, but that would have more complicated implications for performance, and this PR doesn't do anything in that regard.

r? @nikomatsakis cc @Mark-Simulacrum

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.